/**
 * 
 */
package br.edu.flf.teoriagrafos.visao.vo.shape;

import java.awt.Point;

/**
 * @author Rafael Santiago
 * Data: 04/05/2011 - Hora: 10:45:53
 */
public class Oval extends Point{	
	
	private static final long serialVersionUID = 4086214588108384197L;
	private double altura;
	private double largura;
	private Point pontoCentral;

	public Oval(int x, int y) {
		this.x = x;
		this.y = y;
		
		int novoX = (int) (x + this.getLargura()/2);
		int novoY = (int) (y + this.getAltura()/2);
		
		this.setPontoCentral(new Point(novoX, novoY));
	}
	
	/*public Oval(double altura, double largura, int x, int y) {
		this.setAltura(altura);
		this.setLargura(largura);
		
		this.pontoCentral = new Point((int) x,(int) y);
	}*/

	public double getAltura() {
		return altura;
	}
	public void setPontoCentral(Point pontoCentral) {
		this.pontoCentral = pontoCentral;
	}

	public void setAltura(double altura) {
		this.altura = altura;
	}
	public double getLargura() {
		return largura;
	}
	public void setLargura(double largura) {
		this.largura = largura;
	}
	
	public void setCoordenadas(int x, int y){
		this.x = x;
		this.y = y;
		
		int novoX = (int) (x + this.getLargura()/2);
		int novoY = (int) (y + this.getAltura()/2);
		
		this.setPontoCentral(new Point(novoX, novoY));
	}
	
	public int getCoordenadaX() {		
		return x;
	}
	
	public int getCoordenadaY() {		
		return y;
	}
	
	public int getIntLargura() {
		return (int) this.getLargura();
	}
	
	public int getIntAltura() {
		return (int) this.getAltura();
	}
	
	public Point getPontoCentral(){
		return this.pontoCentral;
	}
	
	public int getPCX(){
		return (int) this.pontoCentral.getX();
	}
	
	public int getPCY(){
		return (int) this.pontoCentral.getY();
	}
	
}
